package com.mxpio.erp.common.technology.service;

import com.mxpio.erp.common.enums.OrderStatusEnums;
import com.mxpio.erp.common.technology.entity.BomInfo;
import com.mxpio.erp.common.technology.entity.BomInfoLine;
import com.mxpio.erp.common.technology.entity.VBomInfo;
import com.mxpio.erp.common.technology.vo.*;
import com.mxpioframework.common.vo.Result;
import com.mxpioframework.jpa.query.Criteria;
import com.mxpioframework.system.service.BaseService;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

public interface BomInfoService extends BaseService<BomInfo> {
    Result<BomInfo> updateBomStatus(BomInfo bomInfo, OrderStatusEnums.BomStatus bomStatus);

    BomInfo listBom(String itemCode, VersionVO version,boolean handleVirtualPartFlag);

    List<BomInfo> listHistory(String itemCode);

    Page<BomInfo> page(Pageable page, Criteria c);

    @Transactional
    Page<BomInfoVO> pageWithSub(Pageable page, Criteria c);

    @Transactional
    List<BomInfoVO> listSubView(BomTreeVO vo);

    ImmutablePair<String,String> consumption(ConsumptionVO vo);

    List<BomInfo> listByDate(String dateStr);

    void clacAll();

    List<BomInfoLine> listSub(BomTreeVO vo);

    Result<List<BomInfoLineVO>> inverseQuery(String itemCode, Date date);

    List<BomInfoModel> getUnBomItemList();

    Result<List<ProductBomStockAnalysisVO>> productBomStockAnalysis(String productItemCode, String referenceDate);

    Page<BomInfo> copyTargetPage(Pageable page, Criteria criteria);
}
